dd.image.extend({
    init:function(){},
    /**
     * Loads images for use.
     * @function
     *  @param 
     */
    func:function(o)
    {
        if(dd.is(o.url))
        {
            if(!dd.isArray(o.url))
            {
                o.url = [o.url];
            }
            for(var i = 0; i < o.url.length; i++)
            {
                var img = new Image();
                img.src = o.url[i];
                img.onerror = (function(cb)
                {
                    return function()
                    {
                        cb.call({});
                    };
                })(o.failure);
                img.onload = (function(url, cb)
                {
                    return function()
                    {
                        cb.call({url:url,image:this});
                    };
                })(o.url[i], o.success);
            }
            return true;
        }
        else
        {
            var canvas = document.createElement("canvas");
            canvas.width = o.width;
            canvas.height = o.height;
            var ctx = canvas.getContext("2d");
            ctx.drawImage(o, 0, 0);
            return canvas.toDataURL("image/png");
        }
    }
});